package com.hades.servlet;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class Response1 extends HttpServlet {
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        response.setContentType("text/html; charset=UTF-8");
        response.getWriter().write("Response1界面");// 经过测试Response1界面是显示不出的
        System.out.println("-----经过Response1-----");
        response.sendRedirect("/07_servlet/response2");// 这里的斜杠是被浏览器解析的，得到的是localhost:8080，不到工程名下
        System.out.println("执行完跳转了");
    }
}
